package com.buwstudio.domain.uuid;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * UUID主键的抽象领域模型聚合根基类，无乐观锁
 * 包含spring data jpa提供的记录的创建时间和修改时间的审计功能
 */
@Data
@EqualsAndHashCode(callSuper=true)
@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
public abstract class DomainEntityOptlock extends DomainEntityAuditing{

	private static final long serialVersionUID = 1278346803739268384L;
	
	/**
	 * 乐观锁
	 */
    @Version
    @Column(name = "OPT_LOCK", nullable = false)
    private Long optLock;


}
